<!--公共头部-->
{template 'aitimt/common/header'}
<style>
    * {touch-action: none;}
    html,body{height: 100%;background: #fff}
    .mui-slider{z-index: 5;margin-top:10%;height: 29%;overflow: unset;}
    .mui-slider .mui-slider-group .mui-slider-item img{width: 100%;min-height: 200px;max-height: 200px;}
    .mui-content{background: url({php echo tomedia($photo['bgimg'])});  background-repeat: no-repeat;  background-size: cover;width: 100%;padding: 0 15%;}
    .mui-input-group:before,.mui-input-group:after,.mui-input-group .mui-input-row:after,.mui-input-group .mui-input-row:before{height: 0}
    .mui-content-padded p{color: #422a28;text-align: center;font-size: 20px;}
    .mui-input-row .mui-btn{width: 95%;padding: 0;}
    .mui-btn-primary{width: 70%;margin: 10px 15%;padding: 0}
</style>
<!-- 公共头部start -->
<header class="mui-bar mui-bar-nav">
    <a class="top-return mui-action-back"><img src="{$aideUrl}app/resource/aitimt/images/return.png" ></a>
    <a class="top-logo"><img src="{$aideUrl}app/resource/aitimt/images/logo.png" ></a>
    <!--公共菜单start -->
    {template 'aitimt/common/menu'}
    <!-- 公共菜单end-->
</header>
<!-- 公共头部end -->
<div class="mui-slider">
    <div class="mui-slider-group mui-slider-loop">
        {loop array_reverse(unserialize($photo['atlas'])) $adv}
        <div class="slider-item mui-slider-item mui-slider-item-duplicate"><img src="{php echo tomedia($adv)}" /></div>
        {php break;}
        {/loop}
        {loop unserialize($photo['atlas']) $adv}
        <div class="slider-item mui-slider-item"><img src="{php echo tomedia($adv)}" /></div>
        {/loop}
        <!--支持循环，需要重复图片节点-->
        {loop unserialize($photo['atlas']) $adv}
        <div class="slider-item mui-slider-item mui-slider-item-duplicate"><img src="{php echo tomedia($adv)}" /></div>
        {php break;}
        {/loop}
    </div>
</div>
<div class="mui-content">
    <div class="mui-content-padded">
        <p>赛事成绩查询</p>
    </div>
    <div class="mui-input-group">
        <div class="mui-input-row">
            <select class="mui-btn mui-btn-block" id="race" name="race">
                {loop $activityList $activity}
                <option value="{$activity['raceid']}" {if $raceid==$activity['raceid']}selected="selected"{/if}>{$activity['name']}</option>
                {/loop}

            </select>
        </div>
        <div class="mui-input-row">
            <input type="text" name="raceNum" placeholder="输入参赛号码" value="">
        </div>
    </div>

    <button type="button" class="mui-btn mui-btn-primary mui-btn-block" onclick="sendNum()">查询</button>
</div>
<script type="text/javascript">
    mui.init({
        swipeBack:true //启用右滑关闭功能
    });
    var slider = mui(".mui-slider");
    slider.slider({
        interval: 3000
    });
    function sendNum() {
        var raceNum = $("input[name='raceNum']").val();
        var raceid =  $("#race option:selected").val();
        if($.isEmptyObject(raceid) == true){
            mui.toast("请选择比赛赛事!");
            return false;
        }
        if($.isEmptyObject(raceNum) == true){
            mui.toast("请输入参赛号码!");
            return false;
        }
        $.post("{php echo app_url('home/index/photoh5')}", {raceid:raceid,number:raceNum}, function(data){
            console.log(data);
            if (data.gif.length != 0 && data.jpg.length !=0){
                mui.toast('查询成功,正在为您跳转');
                setTimeout(function(){
                    location.href = "{php echo app_url('home/index/photoshow')}&raceid="+raceid+"&number="+raceNum+"";
                },1000);
            } else {
                mui.toast('当前活动未查询到此号码信息');
            }
        },"json");
    }
</script>

</body>

</html>
